home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2001 April / april_2001.iso / intercd / root / ^Palm / Games / eCross / src / infos / InfosMaker.java next >
Encoding:
Java Source  |  2000-08-01  |  3.3 KB  |  116 lines

  1. import waba.io.*;
  2. import waba.ui.*;
  3.  
  4. public class InfosMaker extends MainWindow
  5. {
  6.   // the creator ID of the software
  7.   private static final String CREATOR_ID = "eCrs";
  8.   private static final String[] PAGES =
  9.   {
  10.     "eCross v1.1\n\n" +
  11.     "www.jext.org\n" +
  12.     "guy.romain@bigfoot.com\n\n" +
  13.     "Coding: Romain Guy\n" +
  14.     "Levels: Benjamin Rigaud\n",
  15.  
  16.     "eCross is a reflexion game based\n" +
  17.     "on a Game Boy cartridge.\n" +
  18.     "The game Mario's Picross is one\n" +
  19.     "of the best ever on Game Boy.\n\n" +
  20.     "Simply follow these instructions\n" +
  21.     "to learn how to play. It is easy.\n",
  22.  
  23.     "Your goal is to find the hidden\n" +
  24.     "picture by filling cells of the grid\n" +
  25.     "using the given informations.\n" +
  26.     "These infos are on left and top of\n" +
  27.     "the grid and given as numbers.\n\n" +
  28.     "You have 30 minutes and your\n" +
  29.     "brain to achieve a level.\n",
  30.  
  31.     "eCross gives you three tools to\n" +
  32.     "help you in your task.\n" +
  33.     "The tools are the marker, the\n" +
  34.     "helper and the eraser.\n\n" +
  35.     "Marker fills in a cell.\n" +
  36.     "Helper ticks a cell.\n" +
  37.     "Eraser cleans a cell.\n",
  38.  
  39.     "To select a tool either tap the\n" +
  40.     "tools icon, either press the\n" +
  41.     "agenda and contacts keys.\n\n" +
  42.     "First key switch forward and\n" +
  43.     "second one backward.\n\n" +
  44.     "Tools order: marker, helper\n" +
  45.     "and eraser.\n",
  46.  
  47.     "Whenever you fill a wrong cell\n" +
  48.     "you lose time.\n" +
  49.     "First error is unpunished, then\n" +
  50.     "you lose two, then four, then six\n" +
  51.     "and finally, 8 minutes.\n\n" +
  52.     "To avoid making mistakes, use\n" +
  53.     "the helper tool to mark the cells\n" +
  54.     "you think to be empty.\n",
  55.  
  56.     "To fill a row or col, you have to\n" +
  57.     "use the series of numbers.\n\n" +
  58.     "Each number tells you how many\n" +
  59.     "successive cells you have to fill.\n" +
  60.     "Between each group of cells,\n" +
  61.     "leave at least one cell empty.\n",
  62.  
  63.     "For instance, the serie \"1 1 2\"\n" +
  64.     "means: fill one cell, leave at least\n" +
  65.     "one blank, fille one cell, leave at\n" +
  66.     "least one blank and fill two cells.\n\n" +
  67.     "As soon as you unhid a group,\n" +
  68.     "surround it with crosses (helper)\n" +
  69.     "because you are sure them to be\n" +
  70.     "empty.\n",
  71.  
  72.     "eCross is (C)2000 Romain Guy\n"+
  73.     "Licensed under GNU GPL\n\n" +
  74.     "Thanks to Guilherme Hazan,\n" +
  75.     "Kevin Yank & Jennifer Shelamer.\n\n" +
  76.     "Refer to HTML documentation\n" +
  77.     "for full explanations.\n"
  78.   };
  79.  
  80.   // creates a new catalog
  81.  
  82.   public void onStart()
  83.   {
  84.     Catalog c = new Catalog("eCross Infos." + CREATOR_ID + ".eCrs", Catalog.READ_ONLY);
  85.     if (c.isOpen())
  86.       c.delete();
  87.  
  88.     c = new Catalog("eCross Infos." + CREATOR_ID + ".eCrs", Catalog.CREATE);
  89.     if (!c.isOpen())
  90.       return;
  91.  
  92.     c.addRecord(1);
  93.     c.writeBytes(new byte[] { (byte) PAGES.length }, 0, 1);
  94.  
  95.     for (int i = 0; i < PAGES.length; i++)
  96.     {
  97.       char[] _c = PAGES[i].toCharArray();
  98.       byte[] b = new byte[_c.length];
  99.       int len = b.length;
  100.  
  101.       for (int j = 0; j < len; j++)
  102.         b[j] = (byte) _c[j];
  103.  
  104.       if (c.addRecord(len) == -1)
  105.         return;
  106.       if (c.writeBytes(b, 0, len) != len)
  107.         return;
  108.     }
  109.  
  110.     c.close();
  111.     exit(0);
  112.   }
  113. }
  114.  
  115. // End of InfosMaker.java
  116.